package adv324;

/**
 * @author oldliu
 * @since 1.0
 */
public class StrTest4 {
    public static void main(String[] args) {
        //String str="We change lives";
        String str="aa33bnlsk43dj0tigerfl67sff33dog10tiger";
        //数字来拆>='0' <='9'
        String[] ar = str.split("");
        System.out.println(ar.length);
        for(String t:ar)
            System.out.println(t);
        System.out.println("-----------数字来拆>---------------");
        String[] a2 = str.split("\\d+");
        for(String t:a2)
            System.out.println(t);
        System.out.println("保留数字，删除其他的字符：");

        String s5 = str.replaceAll("\\D", "");
        System.out.println(s5);

        str="sjdfl啊螺丝扣搭街#￥#@@……&&坊三楼的看法集散地立刻解放上3l33434sdlkf 送到房间里来思考的方式砥砺奋进势力扩大飞机数量开发建设离开房间";
        String s6 = str.replaceAll("[^\\u4e00-\\u9fa5]", "");
        System.out.println(s6);
    }
}
